/**
 * @Description: 插件入口
 * @Author bianpengfei
 * @create 2022/1/2 15:15
 */
import { Vite, Type } from '@bianpengfei/utils'
const { requireAllModule } = Vite

export default {
  install: app => {
    requireAllModule({
      requireContext: import.meta.globEager('./modules/**/*.js'),
      exclude: []
    }).forEach(v => {
      if (Type.isFunction(v?.default?.install)) {
        app.use(v?.default)
      }
    })
  }
}
